fn main() {
    let mut x = 5; // mutable variable
    println!("The value of x is: {x}");
    x = 6;

    {
        let x = x * 2;
        println!("The value of x in the inner scope is: {x}");
    }

    println!("The value of x is: {x}");

    const THREE_HOURS_IN_SECONDS: u32 = 60 * 60 * 3; //必须设置为常量表达式
    println!("The value of x is: {THREE_HOURS_IN_SECONDS}");


    // （元组）

    let tup = (500, 6.4, 1);
    let tup: (i32, f64, u8) = (500, 6.4, 1);
    
    // 第一种取值方式：结构
    let (x, y, z) = tup;

    // 第二种取值方式：索引
    let five_hundred = tup.0;
    let six_point_four = tup.1;
    let one = tup.2;

    println!("The value of y is: {y}");
    println!("The value of x is: {five_hundred}");

    // 空元组又被称为 unit type
    let unitT = ();
    println!("The value of unitT is: {:?}", unitT);



    // [数组]
    let months = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"];
    let a: [i32; 5] = [1, 2, 3, 4, 5]; // i32表示数组元素类型，5表示数组长度
    let b = [3; 5]; // 表示数组元素初始值都为3，长度为5

    let first = a[0];
    let second = a[1];
    println!("The value of first is: {first}");
    
    println!("The 一月的值为: {:?}", months[0]); // :? 表示格式化输出
    println!("The value of b is: {:?}", b);
}